package com.hopu.v1.pojo.classes.attendance;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 考勤规则表
 * @TableName t_attendance_regular
 */
@TableName(value ="t_attendance_regular")
@Data
public class AttendanceRegular implements Serializable {
    /**
     * 主键ID，唯一标识
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 考勤规则名称
     */
    @TableField(value = "regular_name")
    private String regularName;

    /**
     * 上班卡时间，员工应在此时间前打卡
     */
    @TableField(value = "regular_start_hours")
    @JsonFormat(pattern = "HH:mm:ss" , timezone = "GMT+8")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private LocalDateTime regularStartHours;

    /**
     * 下班卡时间，员工应在此时间后打卡
     */
    @TableField(value = "regular_end_hours")
    @JsonFormat(pattern = "HH:mm:ss" , timezone = "GMT+8")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private LocalDateTime regularEndHours;

    /**
     * 规则创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 状态：enabled-启用，disabled-禁用
     */
    @TableField(value = "status")
    private Object status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}